# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=stoken
pkgver=0.93
pkgrel=0
pkgdesc="RSA SecurID-compatible software token for Linux/UNIX systems"
url="https://github.com/cernekee/stoken"
arch="all"
license="LGPL-2.1-or-later"
makedepends="autoconf automake bash libtool libxml2-dev nettle-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cernekee/stoken/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	sed -i s:/bin/bash:/bin/sh:g ./autogen.sh
	./autogen.sh
}

build() {
	./configure \
		--prefix=/usr \
		--datadir=/usr/share \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR=$pkgdir install
}

dev() {
	default_dev
	cd "$builddir"
	rm "$subpkgdir"/usr/share/doc/stoken/*
	rmdir "$subpkgdir"/usr/share/doc/stoken
	rmdir "$subpkgdir"/usr/share/doc
}

sha512sums="
57e67786ec2a0c715e0bb256d359aae147beff72e1922452ed866859b551a6cc6bdce477f5b39c10ee00f5a2620f819660eb2eb706c4d0d3874c9871f29c5cb6  stoken-0.93.tar.gz
"
